home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-04d.zip / 04d / CHIP / Porady / Skuteczne wymazywanie danych / Device Seizure / deviceseizure.exe / RCDATA / CABINET / DeviceSeizureSetup.MSI / scheme2.xslt < prev    next >
Extensible Markup Language  |  2006-10-30  |  16KB  |  391 lines

  1. <?xml version="1.0" ?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  3.     <xsl:output method="html" />
  4.  
  5. <xsl:template match="GridValue">
  6.             <tr>
  7.                 <xsl:apply-templates select="Columns"/>
  8.             </tr>
  9.                 <xsl:apply-templates select="Rows"/>
  10. </xsl:template>
  11.  
  12. <xsl:template match="Bookmark">
  13.     <tr>
  14.         <td>
  15.         <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  16.             <tr><td class="data_text">Name:</td><td class="data_text"><xsl:value-of select="Title"/></td></tr>
  17.             <xsl:apply-templates select="GridValue"/>
  18.         </table>
  19.         </td>
  20.     </tr>
  21. </xsl:template>
  22.  
  23. <xsl:template match="AcqInfo">
  24.     <tr>
  25.         <td>
  26.         <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  27.             <tr><td class="data_text">Name:</td><td class="data_text"><xsl:value-of select="Title"/></td></tr>
  28.             <xsl:apply-templates select="GridValue"/>
  29.         </table>
  30.         </td>
  31.     </tr>
  32. </xsl:template>
  33.  
  34. <xsl:variable name="dirPath">
  35.     <xsl:value-of select="concat(/Node/DataEntity/Link, '/')"/>
  36. </xsl:variable>
  37.  
  38. <xsl:template match="Value">
  39.     <td class="data_text">
  40.         <xsl:choose>
  41.             <xsl:when test="'Binary'=Type or 'Sound'=Type">
  42.                 <a>
  43.                     <xsl:attribute name="href">
  44.                         <xsl:value-of select="concat($dirPath, Link)"/>            
  45.                     </xsl:attribute>
  46.                         <xsl:text>Data >></xsl:text>
  47.                 </a>
  48.             </xsl:when>
  49.             <xsl:when test="'Image'=Type">
  50.                 <a>
  51.                     <xsl:attribute name="href">
  52.                         <xsl:value-of select="concat($dirPath, Link)"/>                    
  53.                     </xsl:attribute>
  54.                     <img>
  55.                         <xsl:attribute name="border">
  56.                             <xsl:value-of select="0"/>
  57.                         </xsl:attribute>
  58.                         <xsl:attribute name="src">
  59.                             <xsl:value-of select="concat($dirPath, Link)"/>
  60.                         </xsl:attribute>
  61.                     </img>
  62.                 </a>
  63.             </xsl:when>
  64.             <xsl:otherwise>
  65. <!--                <xsl:value-of select="Link" /> -->
  66.                 <xsl:call-template name="FormatedOutput">
  67.                     <xsl:with-param name="result" select="Link"/>
  68.                 </xsl:call-template>
  69.             </xsl:otherwise>
  70.         </xsl:choose>
  71.         <xsl:text disable-output-escaping = "yes">&nbsp;</xsl:text>
  72.     </td>
  73. </xsl:template>
  74.  
  75. <xsl:template name="FormatedOutput">
  76.    <xsl:param name="result"/>
  77.    <xsl:choose>
  78.         <xsl:when test="string-length($result) > 60">
  79.             <xsl:value-of select="substring($result,1,59)"/>
  80.             <xsl:text disable-output-escaping = "yes">&shy;</xsl:text>
  81.             <xsl:call-template name="FormatedOutput">
  82.                 <xsl:with-param name="result" select="substring($result,60,string-length($result) - 60)"/>
  83.             </xsl:call-template>
  84.         </xsl:when>
  85.         <xsl:otherwise>
  86.             <xsl:value-of select="$result"/>
  87.         </xsl:otherwise>
  88.     </xsl:choose>
  89. </xsl:template>
  90.  
  91. <xsl:template match="Values">
  92.     <xsl:apply-templates select="Value"/>
  93. </xsl:template>
  94.  
  95. <xsl:template match="Column">
  96.     <td class="data_caption"><xsl:value-of select="Title"/></td>
  97. </xsl:template>
  98.  
  99. <xsl:template match="Row">
  100. <xsl:if test="not(contains(Values/Value/Link,'[internal]'))">
  101.     <tr>
  102.         <xsl:apply-templates select="Values"/>
  103.     </tr>
  104. </xsl:if>    
  105. </xsl:template>
  106.  
  107. <xsl:template match="Columns">
  108.     <xsl:apply-templates select="Column"/>
  109. </xsl:template>
  110.  
  111. <xsl:template match="Rows">
  112.         <xsl:apply-templates select="Row"/>
  113. </xsl:template>
  114.  
  115. <xsl:template name="DataEntity">
  116. <xsl:param name="path" />
  117. <xsl:param name="title" />
  118.     <xsl:choose>
  119.     <xsl:when test="@xsi:type='Value'">
  120.             <tr>
  121.                 <td class="data_text" width="50%">
  122.                 <xsl:value-of select="$path"/>
  123.                 <xsl:choose>
  124.                 <xsl:when test="'Binary'=Type or 'Sound'=Type">
  125.                     <a>
  126.                     <xsl:attribute name="href">
  127.                         <xsl:value-of select="concat($dirPath, Link)"/>            
  128.                     </xsl:attribute>
  129.                         <xsl:value-of select="$title" />
  130.                     </a>
  131.                 </xsl:when>
  132.                 <xsl:when test="'Image'=Type">
  133.                 <a>
  134.                     <xsl:attribute name="href">
  135.                         <xsl:value-of select="concat($dirPath, Link)"/>                    
  136.                     </xsl:attribute>
  137.                     <img>
  138.                         <xsl:attribute name="border">
  139.                             <xsl:value-of select="0"/>
  140.                         </xsl:attribute>
  141.                         <xsl:attribute name="src">
  142.                             <xsl:value-of select="concat($dirPath, Link)"/>
  143.                         </xsl:attribute>
  144.                     </img>
  145.                 </a>
  146.             </xsl:when>
  147.                 <xsl:otherwise>
  148.                     <xsl:value-of select="Link" />
  149.                 </xsl:otherwise>
  150.                 </xsl:choose>
  151.                 </td>
  152.                 
  153.                 <td class="data_text" width="50%">
  154.                 <xsl:value-of select="$path"/>
  155.                 <xsl:choose>
  156.                 <xsl:when test="'Binary'=Type or 'Sound'=Type or 'Image'=Type">
  157.                     <a>
  158.                     <xsl:attribute name="href">
  159.                         <xsl:value-of select="concat($dirPath, Link)"/>
  160.                         <xsl:text>.txt</xsl:text>
  161.                     </xsl:attribute>
  162.                         <xsl:text>Plain Text View</xsl:text>
  163.                   </a>
  164.                 </xsl:when>
  165.                 </xsl:choose>
  166.                 </td>
  167.  
  168. <!-->
  169.                 <td class="data_text">
  170.                     <xsl:choose>
  171.                                         <xsl:when test="'Image'=Type">
  172.                                                 <xsl:value-of select="$title" />
  173.                                         </xsl:when>
  174.                                         <xsl:otherwise>
  175.                                                 <xsl:value-of select="Link" />
  176.                     </xsl:otherwise>
  177.                     </xsl:choose>
  178.                 </td>
  179. <!-->
  180.                 <td class="data_text" width="25%">
  181.                     <xsl:value-of select="Hash/MD5" />
  182.                 </td>
  183.                 <td class="data_text" width="25%">
  184.                     <xsl:value-of select="Hash/SHA1" />
  185.                 </td>
  186.             </tr>
  187.     </xsl:when>
  188.     <xsl:when test="@xsi:type='GridValue'">
  189.         <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  190.             <tr>
  191.                 <xsl:apply-templates select="Columns"/>
  192.             </tr>
  193.                 <xsl:apply-templates select="Rows"/>
  194.         </table>
  195.     </xsl:when>
  196.     <xsl:when test="@xsi:type='Bookmark'">
  197.         <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  198.             <tr>
  199.                 <td class="data_header">Bookmarks</td>
  200.             </tr>
  201.                 <xsl:for-each select="Nodes">
  202.                     <xsl:apply-templates select="Bookmark"/>
  203.                 </xsl:for-each>
  204.         </table>
  205.     </xsl:when>
  206.     <xsl:when test="@xsi:type='AcqInfo'">
  207.         <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  208.             <tr>
  209.                 <td class="data_header">Result of the acquisition</td>
  210.             </tr>
  211.                 <xsl:for-each select="Nodes">
  212.                     <xsl:apply-templates select="AcqInfo"/>
  213.                 </xsl:for-each>
  214.         </table>
  215.     </xsl:when>
  216.     <xsl:otherwise>
  217.     </xsl:otherwise>
  218.     </xsl:choose>
  219. </xsl:template>
  220.  
  221.  
  222. <xsl:template name="Node">
  223. <xsl:param name="level"/>
  224. <xsl:variable name="nodeTitle">
  225.     <xsl:value-of select="Title"/>
  226. </xsl:variable>
  227. <xsl:variable name="nodeType">
  228.     <xsl:value-of select="NodeType"/>
  229. </xsl:variable>
  230. <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  231. <xsl:if test="$nodeType='Folder' or DataEntity/@xsi:type='GridValue' or 0 = $level">
  232. <tr>
  233.     <td class="data_header">
  234.         <xsl:value-of select="Title" />
  235.     </td>
  236. </tr>
  237. </xsl:if>
  238. <tr>
  239.     <td>
  240.     <xsl:for-each select="DataEntity">
  241.         <xsl:call-template name="DataEntity">
  242.             <xsl:with-param name="title" select="$nodeTitle" />
  243.         </xsl:call-template>
  244.     </xsl:for-each>
  245.     
  246.     <xsl:if test="0 = $level">
  247.         <xsl:for-each select="Property">
  248.             <xsl:call-template name="Node">
  249.                 <xsl:with-param name="level" select="1" />
  250.             </xsl:call-template>
  251.         </xsl:for-each>
  252.     </xsl:if>
  253.     </td>
  254. </tr>
  255. </table>
  256.         <xsl:for-each select="Nodes">
  257.             <xsl:variable name="inc_level">
  258.                 <xsl:value-of select="$level + 1"/>
  259.             </xsl:variable>
  260.             
  261.             <xsl:call-template name="Nodes">
  262.                    <xsl:with-param name="level" select="$inc_level" />
  263.             </xsl:call-template>
  264.         </xsl:for-each>
  265.  
  266. </xsl:template>
  267.  
  268. <xsl:template name="Nodes">
  269. <xsl:param name="level"/>
  270.     <xsl:for-each select="Node">
  271.         <xsl:call-template name="Node">
  272.             <xsl:with-param name="level" select="$level" />
  273.         </xsl:call-template>
  274.     </xsl:for-each>
  275. </xsl:template>
  276.  
  277. <xsl:template match="/Node">
  278.     <xsl:for-each select="Nodes">
  279.         <xsl:call-template name="Nodes">
  280.             <xsl:with-param name="level" select="0" />
  281.         </xsl:call-template>
  282.     </xsl:for-each>
  283. </xsl:template>
  284.  
  285. <xsl:template match="/Node/Nodes/Node/DataEntity">
  286.     <xsl:if test="@xsi:type='CaseInfo'">
  287.         <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  288.             <tr>
  289.                    <td class="data_header">Case Information</td>
  290.             </tr>
  291.             <tr>
  292.                 <td>
  293.                     <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  294.                             <xsl:apply-templates select="GridValue"/>
  295.                     </table>
  296.                 </td>
  297.            </tr>
  298.         </table>
  299.         <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  300.             <tr>
  301.                    <td class="data_header">Hashes</td>
  302.             </tr>
  303.             <tr>
  304.                 <td>
  305.                     <table class="border" border="1" cellspacing="1" cellpadding="1" width="100%">
  306.                         <tr><td class="data_text">MD5</td><td class="data_text"><xsl:value-of select="OriginalMD5"/></td></tr>
  307.                         <tr><td class="data_text">SHA1</td><td class="data_text"><xsl:value-of select="OriginalSHA1"/></td></tr>
  308.                     </table>
  309.                 </td>
  310.              </tr>
  311.  
  312.         </table>
  313.     </xsl:if>
  314. </xsl:template>
  315.  
  316.  
  317.     <xsl:template match="/">
  318.         <html>
  319.             <head>
  320.                 <title><xsl:value-of select="Node/@ProductName"/> Exported Case</title>
  321.                 <style type="text/css" media="print">
  322.                     <xsl:comment>  
  323.                     DIV {display:none;}
  324.                     A.ex_button:active {display:none;}
  325.                     A.ex_button:link {display:none;}
  326.                     A.ex_button:visited {display:none;}
  327.                     A.ex_button:hover {display:none;}
  328.                     </xsl:comment>
  329.                 </style>
  330.                 <style type="text/css" media="screen">
  331.                     <xsl:comment>
  332.          UL.tree {LIST-STYLE-TYPE : disc;}  
  333.          BODY {  }
  334.          .border { BORDER : 1px solid #06331B;}
  335.          TD.header { BORDER: none; BACKGROUND-COLOR : #06331B; COLOR: #FFFFFF; FONT-SIZE: 10pt; FONT-WEIGHT : bolder; TEXT-INDENT: 5px;}
  336.          TABLE.props { BORDER-LEFT : 1px solid #6E7D75; BORDER-BOTTOM : 1px solid #6E7D75; BACKGROUND-COLOR: #FFFFFF; FONT-SIZE: 10pt;  FONT-WEIGHT : bold }
  337.          TD.props_header { COLOR: #FFFFFF; BACKGROUND-COLOR: #6E7D75; FONT-SIZE: 10pt;  FONT-WEIGHT : bold }
  338.          TD.props_caption { COLOR: #325074; BACKGROUND-COLOR: #E4E8E7; FONT-SIZE: 10pt;  FONT-WEIGHT : bold; TEXT-ALIGN : right}
  339.          TD.props_text { BORDER : none; BORDER-BOTTOM: 1px solid #E4E8E7; BORDER-RIGHT: 1px solid #E4E8E7; BORDER: 1px solid #E4E8E7; COLOR: #000000; BACKGROUND-COLOR: #FFFFFF; FONT-SIZE: 10pt;  FONT-WEIGHT : normal; TEXT-ALIGN : left; TEXT-INDENT: 5px}
  340.          TABLE.data { BORDER : none; BORDER-LEFT: 1px solid #6E7D75; BORDER-BOTTOM: 1px solid #6E7D75; BACKGROUND-COLOR: #FFFFFF; FONT-SIZE: 10pt;  FONT-WEIGHT : bold}
  341.          TD.data_header { BORDER : none; COLOR: #FFFFFF; BACKGROUND-COLOR: #6E7D75; FONT-SIZE: 10pt;  FONT-WEIGHT : bold }
  342.          TD.data_caption { COLOR: #325074; BACKGROUND-COLOR: #E4E8E7; FONT-SIZE: 10pt;  FONT-WEIGHT : bold; TEXT-ALIGN : center}
  343.          TD.data_text { BORDER : none; BORDER-LEFT: 1px solid #E4E8E7; BORDER-BOTTOM: 1px solid #E4E8E7; COLOR: #000000; BACKGROUND-COLOR: #FFFFFF; FONT-SIZE: 10pt;  FONT-WEIGHT : normal; TEXT-ALIGN : left; TEXT-INDENT: 5px}
  344.          TABLE.phone_item { BORDER : none; COLOR: #FFFFFF; BACKGROUND-COLOR: FFFFFF; FONT-SIZE: 10pt; FONT-WEIGHT : bold }
  345.          TD.phone_item_text{ BORDER: none; BACKGROUND-COLOR : #06331B; COLOR: #FFFFFF; FONT-SIZE: 12pt; FONT-WEIGHT : bolder; PADDING: 5pt; TEXT-ALIGN: center;}
  346.          A.ref:active { BORDER: none;COLOR: #325074;FONT-SIZE: 10pt; TEXT-DECORATION : none;}
  347.          A.ref:link { BORDER: none;COLOR: #325074;FONT-SIZE: 10pt; TEXT-DECORATION : none;}
  348.          A.ref:visited { BORDER: none;COLOR: #325074;FONT-SIZE: 10pt; TEXT-DECORATION : none;}
  349.          A.ref:hover { BORDER: none;BORDER-BOTTOM: 1px dotted #000000;COLOR: #325074;FONT-SIZE: 10pt; TEXT-DECORATION : none}
  350.          A.ex_button:active {BORDER: none;COLOR: #325074; FONT-SIZE: 11pt; TEXT-DECORATION : none; TEXT-ALIGN: center;}
  351.          A.ex_button:link {BORDER: none;COLOR: #325074;FONT-SIZE: 11pt; TEXT-DECORATION : none; TEXT-ALIGN: center;}
  352.          A.ex_button:visited {BORDER: none;COLOR: #325074;FONT-SIZE: 11pt; TEXT-DECORATION : none; TEXT-ALIGN: center;}
  353.          A.ex_button:hover {BORDER: none;COLOR: #E4E8E7;BACKGROUND-COLOR: #06331B;FONT-SIZE: 11pt; TEXT-ALIGN: center;}
  354.                     </xsl:comment>
  355.                 </style>
  356.                 <script language="javascript">
  357.                     <![CDATA[
  358.                     var counter = 0;
  359.                     function show(id){
  360.                         var table=document.getElementById("t_"+id);
  361.                             if(table){
  362.                             if(table.style.display!="none"){
  363.                             table.style.display="none";
  364.                                     document.getElementById("a_"+id).innerHTML=" + ";
  365.                             }else{
  366.                             table.style.display="";
  367.                                     document.getElementById("a_"+id).innerHTML="  - ";
  368.                             }
  369.                             }
  370.                     }
  371.                     function fiximagessize()
  372.                                         {
  373.                                                 for(var i=0;i<document.images.length;i++)
  374.                                                 {
  375.                                                         var im=document.images.item(i);
  376.                                                         if(im.width>100) im.width=100;
  377.                                                         if(im.heigth>100) im.heigth=100;
  378.  
  379.                                                 }
  380.                                         }
  381.                     ]]>
  382.                 </script>
  383.             </head>
  384.             <body onload="fiximagessize()">
  385.                 <xsl:apply-templates select="/Node/Nodes/Node/DataEntity"/>
  386.                 <xsl:apply-templates select="/Node"/>
  387.             </body>
  388.         </html>
  389.     </xsl:template>
  390. </xsl:stylesheet>
  391.